//
// * Copyright (c) 2002-2009 "Neo Technology,"
// *     Network Engine for Objects in Lund AB [http://neotechnology.com]
// *
// * This file is part of Neo4j.
// * 
// * Neo4j is free software: you can redistribute it and/or modify
// * it under the terms of the GNU Affero General Public License as
// * published by the Free Software Foundation, either version 3 of the
// * License, or (at your option) any later version.
// * 
// * This program is distributed in the hope that it will be useful,
// * but WITHOUT ANY WARRANTY; without even the implied warranty of
// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// * GNU Affero General Public License for more details.
// * 
// * You should have received a copy of the GNU Affero General Public License
// * along with this program. If not, see <http://www.gnu.org/licenses/>.
// 
namespace org.neo4j.kernel.impl.core
{

	using TransactionManager = javax.transaction.TransactionManager;

	using Node = org.neo4j.graphdb.Node;
	using Relationship = org.neo4j.graphdb.Relationship;
	using RelationshipType = org.neo4j.graphdb.RelationshipType;
	using AdaptiveCacheManager = org.neo4j.kernel.impl.cache.AdaptiveCacheManager;
	using IdGenerator = org.neo4j.kernel.impl.persistence.IdGenerator;
	using PersistenceManager = org.neo4j.kernel.impl.persistence.PersistenceManager;
	using LockManager = org.neo4j.kernel.impl.transaction.LockManager;

	internal class ReadOnlyNodeManager : NodeManager
	{
		internal ReadOnlyNodeManager(AdaptiveCacheManager cacheManager, LockManager lockManager, LockReleaser lockReleaser, TransactionManager transactionManager, PersistenceManager persistenceManager, IdGenerator idGenerator, bool useNewCaches) : base(cacheManager, lockManager, lockReleaser, transactionManager, persistenceManager, idGenerator, useNewCaches)
		{
		}

		public override Node createNode()
		{
			throw new ReadOnlyNeoException();
		}

		public override Relationship createRelationship(Node startNode, Node endNode, RelationshipType type)
		{
			throw new ReadOnlyNeoException();
		}

		internal override PropertyIndex createPropertyIndex(string key)
		{
			throw new ReadOnlyNeoException();
		}

		internal override void deleteNode(NodeImpl node)
		{
			throw new ReadOnlyNeoException();
		}

		internal override int nodeAddProperty(NodeImpl node, PropertyIndex index, object @value)
		{
			throw new ReadOnlyNeoException();
		}

		internal override void nodeChangeProperty(NodeImpl node, int propertyId, object @value)
		{
			throw new ReadOnlyNeoException();
		}

		internal override void nodeRemoveProperty(NodeImpl node, int propertyId)
		{
			throw new ReadOnlyNeoException();
		}

		internal override void deleteRelationship(RelationshipImpl rel)
		{
			throw new ReadOnlyNeoException();
		}

		internal override int relAddProperty(RelationshipImpl rel, PropertyIndex index, object @value)
		{
			throw new ReadOnlyNeoException();
		}

		internal override void relChangeProperty(RelationshipImpl rel, int propertyId, object @value)
		{
			throw new ReadOnlyNeoException();
		}

		internal override void relRemoveProperty(RelationshipImpl rel, int propertyId)
		{
			throw new ReadOnlyNeoException();
		}
	}
}